package com.woniuxy03;

import java.io.File;
import java.io.IOException;

/**
 * @author 作者
 * @create 2025-06-09 16:00
 */
public class Test01 {
    public static void main(String[] args)  {
        File file=new File("d:\\aaa");
        File[] files=file.listFiles();
        for(File myFile:files){
            System.out.println(myFile.getAbsolutePath());
        }
    }

    private static void test04() {
        File file=new File("d:\\aaa");
        String[] list = file.list();
        for(String str:list){
            System.out.println(str);
        }
    }

    private static void test03() throws IOException {
        File file=new File("d:\\aaa\\b.txt");
        System.out.println(file.createNewFile());
        System.out.println(file.createNewFile());
    }

    private static void test02() {
        File file1 = new File("d:\\aaa");
        System.out.println(file1.getAbsolutePath());
        File file2 = new File("d:\\aaa","bbb\\ccc\\d.txt");
        System.out.println(file2.getAbsolutePath());
        System.out.println(file2.isDirectory());
    }

    private static void test01() {
        //创建目录对象，对应的就是d:\aaa这个目录
        File file1 = new File("d:\\aaa");
        System.out.println(file1.exists());
        File file2 = new File("d:\\bbb");
        System.out.println(file2.exists());
        System.out.println(file1.isDirectory());
        System.out.println(file1.isFile());
        File file3 = new File("d:\\aaa\\a.txt");
        System.out.println(file3.isDirectory());
        System.out.println(file3.isFile());
    }
}
